<!--
 * @Description: 活动列表模块    type [home 列表] [details 详情]
 * @Author: 老五 13521685612@163.com
 * @Date: 2024-11-01 01:55:44
 * @LastEditors: 老五 13521685612@163.com
 * @LastEditTime: 2024-11-17 22:50:40
 * @FilePath: /lieshou-app/components/z-activity-list.vue
-->

<template>
	<view>
		<view v-if="type==='home'">
			<view class="activity-list" v-for="(item,index) in activityList" :key="index"
				@click="getDetails(item,index)">
				<image class="activity-list-img" :src="item.cover"></image>
				<view class="activity-list-bottom">
					<view class="activity-list-bottom-title">
						{{item.name?item.name:'活动名称'}}
					</view>
					<view class="activity-list-bottom-tag">
						<view class="activity-list-flex">
							<view class="activity-list-bottom-fu"></view>
							<view class="activity-list-bottom-date">
								活动时间：{{item.start_time?((item.start_time)+'-'+(item.end_time)):'2024年3月1日-16日'}}
							</view>
						</view>
					</view>
					<view class="activity-list-bottom-btn" >参加活动</view>
				</view>
			</view>
		</view>
		<view v-if="type==='details'">
			<view class="activity-list active">
				<image class="activity-list-img" src="@/static/image/default/activity-default.png"></image>
				<view class="activity-list-bottom">
					<view class="activity-list-bottom-title">
						{{title}}
					</view>
					<view class="activity-list-bottom-tag">
						<view class="activity-list-bottom-fu"></view>
						<view class="activity-list-bottom-date">活动时间：{{date?date:'2024年3月1日-16日'}} </view>
					</view>
					<!-- <view class="activity-list-bottom-btn">参加活动</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "z-activity-list",
		props: ['activityList', 'type', 'date', 'title'],
		data() {
			return {

			};
		},
		methods: {
			// 详情
			getDetails(item, index) {
				uni.navigateTo({
					url: `/pages/activity_details?cover=${item.cover}&detail=${item.detail}&end_time=${item.end_time}&id=${item.id}&join=${item.join}&isJoin=${item.join?'isJoin':'noJoin'}&name=${item.name}&start_time=${item.start_time}`
				})
			}
		}
	}
</script>

<style lang="scss">
	.active {
		box-shadow: 0rpx 8rpx 8rpx rgba(0, 0, 0, 0.25);
	}

	.activity-list {
		width: 690rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		background-color: #fff;
		margin-bottom: 30rpx;
		border-left: 2rpx solid rgba(235, 236, 237, 1);
		border-right: 2rpx solid rgba(235, 236, 237, 1);
		border-bottom: 2rpx solid rgba(235, 236, 237, 1);
		// border-radius: 15rpx;
		border-top-left-radius: 30rpx;
		border-top-right-radius: 30rpx;
		position: relative;
		border-bottom-left-radius: 30rpx;
		border-bottom-right-radius: 30rpx;

		.activity-list-bottom-btn {
			position: absolute;
			right: 26rpx;
			bottom: 38rpx;
			width: auto;
			font-size: 24rpx;
			font-weight: 500;
			padding: 6rpx 20rpx;
			color: rgba(255, 255, 255, 1);
			text-align: center;
			vertical-align: top;
			border-radius: 30rpx;
			background: rgba(0, 0, 0, 1);
		}

		.activity-list-img {
			width: 100%;
			height: 314rpx;
			object-fit: cover;
			border-top-left-radius: 15rpx;
			border-top-right-radius: 15rpx;
		}

		.activity-list-bottom {
			width: 100%;
			position: relative;
			text-align: left;
			padding-bottom: 10rpx;

			.activity-list-bottom-title {
				margin: 24rpx 0rpx 38rpx 30rpx;
				font-size: 28rpx;
				font-weight: 500;
				color: rgba(0, 0, 0, 1);
				text-align: left;
				vertical-align: top;
			}

			.activity-list-bottom-tag {
				// width: 100%;
				// height: 34rpx;
				// margin: 20rpx 0rpx 0rpx 30rpx;
				// display: inline-block;
				display: inline-block;
				width: auto;
				// text-align: center;
				height: 34rpx;
				position: relative;
				padding-left: 30rpx;
				bottom: 30rpx;
				padding-top: 10rpx;

				.activity-list-bottom-fu {
					width: auto;
					height: 14rpx;
					position: relative;
					top: 30rpx;
					will-change: transform, filter;
					border-radius: 10rpx;
					background: rgba(252, 205, 229, 1);
					opacity: 1;
					filter: blur(6rpx);
				}

				.activity-list-bottom-date {
					font-size: 24rpx;
					font-weight: 500;
					margin-left: 5rpx;
					position: relative;
					text-align: center;
					// bottom: 30rpx;
					color: rgba(0, 0, 0, 1);
					vertical-align: top;
				}


			}


		}

	}
</style>